#include "pet.h"

Pet::Pet(QObject *parent) : QObject(parent)
{
}

Pet::Pet(const Pet &info): QObject( nullptr ),
    m_id(info.m_id),
    m_name(info.m_name),
    m_sex(info.m_sex),
    m_age(info.m_age),
    m_kind(info.m_kind),
    m_owner_id(info.m_owner_id),
    m_owner(info.m_owner),
    m_status(info.m_status),
    m_phone(info.m_phone)

{
}

Pet::Pet(int id, QString name, QString sex, float age, QString kind, int owner_id, QString owner, QString status, QString phone):
    m_id(id),
    m_name(name),
    m_sex(sex),
    m_age(age),
    m_kind(kind),
    m_owner_id(owner_id),
    m_owner(owner),
    m_status(status),
    m_phone(phone)
{

}

QStringList Pet::getInfo()
{
    QStringList info;
    info.push_back(QString::number(this->m_id));
    info.push_back(this->m_name);
    info.push_back(this->m_sex);
    info.push_back(QString("%1").arg(this->m_age));
    info.push_back(this->m_kind);
    info.push_back(QString::number(this->m_owner_id));
    info.push_back(this->m_owner);
    info.push_back(this->m_status);
    info.push_back(m_phone);

    return info;
}

Pet Pet::operator=(const Pet &info)
{
    Pet pe(info);
    return pe;
}

